package com.mz.ozy.widget.dialog;

import android.app.Activity;
import android.content.Context;
import android.view.Gravity;
import android.view.View;

import com.mz.ozy.R;
import com.umeng.socialize.bean.SHARE_MEDIA;

public class ShareDialog extends BaseDialog implements View.OnClickListener{

    public ShareDialog(Activity mContext) {
        super(mContext, R.layout.dialog_share, Gravity.BOTTOM, true, true);
        initView();
    }

    private void initView(){
        setOnViewClick(R.id.tv_wx,this);
        setOnViewClick(R.id.tv_wx_circle,this);
        setOnViewClick(R.id.tv_qq,this);
        setOnViewClick(R.id.tv_qq_zone,this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.tv_wx:
                mListener.onConfirm(SHARE_MEDIA.WEIXIN);
                break;
            case R.id.tv_wx_circle:
                mListener.onConfirm(SHARE_MEDIA.WEIXIN_CIRCLE);
                break;
            case R.id.tv_qq:
                mListener.onConfirm(SHARE_MEDIA.QQ);
                break;
            case R.id.tv_qq_zone:
                mListener.onConfirm(SHARE_MEDIA.QZONE);
                break;
        }
    }

    private onDialogListener mListener;
    public void setOnDialogListener(onDialogListener listener){
        mListener = listener;
    }
    public interface onDialogListener{
        void onConfirm(SHARE_MEDIA platform);
    }
}
